<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>Big store a Ecommerce Online Shopping Category Flat Bootstrap Responsive Website Template | Register :: w3layouts</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta property="og:title" content="Vide" />
<meta name="keywords" content="Big store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- Custom Theme files -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link href="css/font-awesome.css" rel="stylesheet">
<!-- js -->
<script src="js/jquery-1.11.1.min.js"></script>
<!-- //js -->
<!-- start-smoth-scrolling -->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function($) {
		$(".scroll").click(function(event){		
			event.preventDefault();
			$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
		});
	});
</script>
<!-- start-smoth-scrolling -->

</head>
<body>
<div class="header">
	<div class="container">
		<div class="logo">
			<h1 ><a href="index.html"><b>T<br>H<br>E</b>Big Store<span>The Best Supermarket</span></a></h1>
		</div>
		<div class="head-t">
			<ul class="card">
				<li id="usercenter" style="display: none"><a class="withtoken" id="a_usercenter" href="usercenter.html" ><i class="fa fa-user" aria-hidden="true"></i>个人中心</a></li>
				<li id="login"><a class="withtoken" href="login.html" ><i class="fa fa-user" aria-hidden="true"></i>登录</a></li>
				<li id="register"><a class="withtoken" href="register.html" ><i class="fa fa-arrow-right" aria-hidden="true"></i>注册</a></li>
				<li><a class="withtoken" href="orderlist.html" ><i class="fa fa-file-text-o" aria-hidden="true"></i>订单列表</a></li>
				<li><a class="withtoken" href="wishlist.html" ><i class="fa fa-heart" aria-hidden="true"></i>收藏</a></li>
				<li><a class="withtoken" href="cart.html" ><i class="fa fa-shopping-cart" aria-hidden="true"></i>购物车</a></li>
			</ul>
		</div>
		<script type="text/javascript">
            $(function(){
                var _this1=null;
                $('.nav>li').hover(function(){
                    _this1=$(this);
                    _this1.find('.second-nav').show();
                    var _this2=null;
                    _this1.find('.second-nav').find('li').hover(function(){
                        _this2=$(this);
                        _this2.find('.third-nav').show();
                        _this2.find('.third-nav').hover(function(){
                            $(this).show();
                        },function(){
                            $(this).hide();
                        });
                    },function(){
                        _this2.find('.third-nav').hide();
                    });
                },function(){
                    _this1.find('.second-nav').hide();
                });
            });
		</script>
		<div class="nav-top">
			<nav class="navbar navbar-default">

				<div class="collapse navbar-collapse" id="bs-megadropdown-tabs">
					<ul class="nav navbar-nav ">
						<li> <!--class=" active"--> <a href="index.html" class="hyper "><span>主页</span></a></li>

						<li class="dropdown">
							<a href="#" class="dropdown-toggle  hyper" data-toggle="dropdown" >
								<span> 商品类别 <b class="caret"></b></span>
							</a>
							<ul class="dropdown-menu multi second-nav" id="dropdown-ul">
								<!--<li ><a href="#">饮料&nbsp;&nbsp;&nbsp;&nbsp;></a>
									<ul class="dropdown-menu multi third-nav">
										<li><a href="#">汽水饮料</a></li>
										<li><a href="#">酒精饮料</a></li>
										<li><a href="#">纯牛奶</a></li>
										<li><a href="#">酸牛奶</a></li>
										<li><a href="#">其他饮料</a></li>
									</ul>
								</li>
								<li><a href="#">零食&nbsp;&nbsp;&nbsp;&nbsp;></a>
									<ul class="dropdown-menu multi third-nav">
										<li><a href="#">辣条</a></li>
										<li><a href="#">饼干</a></li>
										<li><a href="#">面包</a></li>
										<li><a href="#">坚果</a></li>
										<li><a href="#">其他零食</a></li>
									</ul>
								</li>
								<li><a href="#">水果&nbsp;&nbsp;&nbsp;&nbsp;></a>
									<ul class="dropdown-menu multi third-nav">
										<li><a href="#">苹果</a></li>
										<li><a href="#">香蕉</a></li>
										<li><a href="#">葡萄</a></li>
										<li><a href="#">芒果</a></li>
										<li><a href="#">其他水果</a></li>
									</ul>
								</li>
								<li><a href="#">烟酒&nbsp;&nbsp;&nbsp;&nbsp;></a></li>
								<li><a href="#">厨具&nbsp;&nbsp;&nbsp;&nbsp;></a></li>
								<li><a href="#">蔬菜&nbsp;&nbsp;&nbsp;&nbsp;></a></li>
								<li><a href="#">鲜肉&nbsp;&nbsp;&nbsp;&nbsp;></a></li>-->
							</ul>
						</li>

						<li><a href="hot.html" class="hyper "><span> 热卖商品 </span></a></li>

						<li><a href="activities.html" class="hyper "><span> 促销活动 </span></a></li>

						<li><a href="contact.html" class="hyper"><span> 联系我们 </span></a></li>
					</ul>
				</div>
			</nav>

			<!--<div class="cart" >
                <span class="fa fa-shopping-cart my-cart-icon"><span class="badge badge-notify my-cart-badge"></span></span>
            </div>-->
			<div class="clearfix"></div>
		</div>

	</div>
</div>
  <!---->

     <!--banner-->
<div class="banner-top">
	<div class="container">
		<h3 >Register</h3>
		<h4><a href="index.html">Home</a><label>/</label>Register</h4>
		<div class="clearfix"> </div>
	</div>
</div>

<!--login-->

	<div class="login">
		<div class="main-agileits">
				<div class="form-w3agile form1">
					<h3>Register</h3>
					<form >
						<!--<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" value="Username" name="Username" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Username';}" required="true">
							<div class="clearfix"></div>
						</div>
						<div class="key">
							<i class="fa fa-lock" aria-hidden="true"></i>
							<input  type="password" value="Password" name="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}" required="true">
							<div class="clearfix"></div>
						</div>
						<div class="key">
							<i class="fa fa-lock" aria-hidden="true"></i>
							<input  type="password" value="Confirm Password" name="Confirm Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Confirm Password';}" required="">
							<div class="clearfix"></div>
						</div>-->
						<label>邮箱地址</label>
						<div class="key">
							<i class="fa fa-envelope" aria-hidden="true"></i>
							<input  type="text" id="email" name="email"  required="true">
							<div class="clearfix"></div>
						</div>
						<label>密码</label>
						<div class="key">
							<i class="fa fa-lock" aria-hidden="true"></i>
							<input  type="password" id="password1" required="true">
							<div class="clearfix"></div>
						</div>
						<label>确认密码</label>
						<div class="key">
							<i class="fa fa-lock" aria-hidden="true"></i>
							<input  type="password" id="password2"  required="true">
							<div class="clearfix"></div>
						</div>
						<label>收货地址-省份</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="sheng"  required="true"/>
							<div class="clearfix"></div>
						</div>
						<label>收货地址-市</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="shi"  required="true">
							<div class="clearfix"></div>
						</div>
						<label>收货地址-区/县</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="xian" name="xian"  required="true"/>
							<div class="clearfix"></div>
						</div>
						<label>收货地址-街道/乡</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="xiang" name="xiang"  required="true">
							<div class="clearfix"></div>
						</div>
						<label>收货地址-其他详细地址</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="other" name="other" required="true">
							<div class="clearfix"></div>
						</div>
						<label>收货人</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="name" name="name" required="true">
							<div class="clearfix"></div>
						</div>
						<label>联系电话</label>
						<div class="key">
							<i class="fa fa-user" aria-hidden="true"></i>
							<input  type="text" id="phone" name="phone" required="true">
							<div class="clearfix"></div>
						</div>
						<input type="button" value="Submit" onclick="register()" >
						<script>
							function register() {
							    var email = document.getElementById('email').value;
								var pwd1 = document.getElementById('password1').value;
								var pwd2 = document.getElementById('password2').value;
                                var sheng = document.getElementById('sheng').value;
                                var shi = document.getElementById('shi').value;
                                var xian = document.getElementById('xian').value;
                                var xiang = document.getElementById('xiang').value;
                                var other = document.getElementById('other').value;
                                var name = document.getElementById('name').value;
                                var phone = document.getElementById('phone').value;

                                //alert('pwd1:'+pwd1+'  pwd2:'+pwd2);

                                if(email == null || email == ''){
                                    alert('请输入邮箱');
								}else if(pwd1 == null || pwd1 == ''){
                                    alert('请输入密码');
								}else if(pwd2 == null || pwd2 == ''){
                                    alert('请确认密码');
                                }else if(sheng == null || sheng == ''){
                                    alert('请输入收货省份');
                                }else if(shi == null || shi == ''){
                                    alert('请输入收货市');
                                }else if(xian == null || xian == ''){
                                    alert('请输入收货区或县');
                                }else if(xiang == null || xiang == ''){
                                    alert('请输入收货街道或乡镇');
                                }else if(other == null || other == ''){
                                    alert('请输入其他详细收货地址');
                                }
                                else if(pwd1 != pwd2){
								    alert('两次输入的密码不一致，请重新输入！');
								}else {
                                    var responseBody = $.ajax({
                                        url: "/v1/register",
                                        method: "POST",
                                        async: false,
                                        data: {
                                            "username": email,
                                            "password": pwd1,
                                            "addr_sheng": sheng,
                                            "addr_shi": shi,
                                            "addr_qu_xian": xian,
                                            "addr_xiang_jiedao": xiang,
                                            "addr_other": other,
                                            "name": name,
                                            "phone": phone
                                        }
                                    });
                                    var status = responseBody.responseText;
                                    console.log('status:', status);
                                    if (status == '1') {
                                        alert("注册成功，请登录");
                                        window.location = 'login.html';
                                    } else if (status == '-1') {
                                        alert("email已被注册，请使用其他邮箱。");
                                    } else {
                                        alert("网络错误，请重试！");
                                    }
                                }
                            }
						</script>
					</form>
				</div>
			</div>
		</div>
<!--footer-->
<div class="footer">
	<div class="container">
		<div class="col-md-3 footer-grid">
			<h3>About Us</h3>
			<p>Big Store 是阿里巴巴集团全力打造的网上超市。Big Store 为广大网购消费者提供进口食品、食品饮料、粮油副食、美容洗护、家居用品、家庭清洁、
				母婴用品等所有生活必需品，商品品质100%保证。随时随地，轻松用手机或鼠标逛超市，生活快消品一次性购齐，不用排队、送货上门，
				还提供7天无理由退货服务。Big Store，让生活更简单。</p>
		</div>

		<div class="col-md-2 footer-grid "></div>

		<div class="col-md-3 footer-grid ">
			<h3>Menu</h3>
			<ul>
				<li><a href="index.html">主页</a></li>
				<li><a href="hot.html">热卖商品</a></li>
				<li><a href="activities.html">促销活动</a></li>
				<li><a href="contact.html">联系我们</a></li>
			</ul>
		</div>

		<div class="col-md-3 footer-grid">
			<h3>My Account</h3>
			<ul>
				<li><a href="login.html">登录</a></li>
				<li><a href="register.html">注册</a></li>
				<li><a href="wishlist.html">收藏</a></li>
				<li><a href="cart.html">购物车</a></li>
			</ul>
		</div>
		<div class="clearfix"></div>

		<div class="copy-right">
			<p> &copy; 2018 Big store. All Rights Reserved </p>
		</div>
	</div>
</div>
<!-- //footer-->
<script src="js/header_category.js"/>
	<script type="text/javascript">
		$(document).ready(function() {
            loadUserName(token);
		/*
			var defaults = {
			containerID: 'toTop', // fading element id
			containerHoverID: 'toTopHover', // fading element hover id
			scrollSpeed: 1200,
			easingType: 'linear' 
			};
		*/								
		$().UItoTop({ easingType: 'easeOutQuart' });
		});
	</script>
	<a href="#" id="toTop" style="display: block;"> <span id="toTopHover" style="opacity: 1;"> </span></a>
<!-- //smooth scrolling -->
<!-- for bootstrap working -->
		<script src="js/bootstrap.js"></script>
<!-- //for bootstrap working -->
<script type='text/javascript' src="js/jquery.mycart.js"></script>
  <script type="text/javascript">
  $(function () {

    var goToCartIcon = function($addTocartBtn){
      var $cartIcon = $(".my-cart-icon");
      var $image = $('<img width="30px" height="30px" src="' + $addTocartBtn.data("image") + '"/>').css({"position": "fixed", "z-index": "999"});
      $addTocartBtn.prepend($image);
      var position = $cartIcon.position();
      $image.animate({
        top: position.top,
        left: position.left
      }, 500 , "linear", function() {
        $image.remove();
      });
    }

    $('.my-cart-btn').myCart({
      classCartIcon: 'my-cart-icon',
      classCartBadge: 'my-cart-badge',
      affixCartIcon: true,
      checkoutCart: function(products) {
        $.each(products, function(){
          console.log(this);
        });
      },
      clickOnAddToCart: function($addTocart){
        goToCartIcon($addTocart);
      },
      getDiscountPrice: function(products) {
        var total = 0;
        $.each(products, function(){
          total += this.quantity * this.price;
        });
        return total * 1;
      }
    });

  });
  </script>

</body>
</html>